<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>


<s:if test="childSponsorList.size != 0" >

	<div>
	  <table style="margin-top: 10px" width="100%" id="commonTable" class="blueTbl">
	  	<tr>
	  		<th style="width:20px"></th>
	  		<th style="width:120px">Name</th>
	  		<th>Full Name</th>
	  		<th style="width:60px">Code</th>
	  		<th style="width:70px">Sex Type</th>
	  		<th>Date Of Birth</th>
	  		<th style="width:50px">Grade</th>

	  	</tr>
		<s:iterator value="childSponsorList" status="rowIndex">
			<tr>
			 <td><s:property value="%{#rowIndex.index + 1}"/>
			 <td><s:property value="child.name" /></td>
			 <td>
			 	<s:url var="childViewUrl" action="view" namespace="/child" includeParams="none">
			 		<s:param name="id" value="child.id"></s:param>
			 	</s:url>
			 	<sj:a href="%{#childViewUrl}" targets="childResultDiv" title="Code: %{code}"><s:property value="child.fullName"/></sj:a>
			 </td>
			 <td><s:property value="child.code" /></td>
			 <td><s:property value="child.sexType"/></td>
			 <td><s:date name="child.dateOfBirth.time" format="yyyy/MM/dd"/></td>
			 <td><s:property value="child.grade"/></td>
		</s:iterator>
	</table>
	</div>
</s:if>
<s:else>
  <div class="error">No child found. Please contact the administrator, if your children are not in the list</div>
</s:else>

   <script type="text/javascript">

		$("tr").not(':first').hover(
		  function () {
		    $(this).css("color","#000088");
		  },
		  function () {
		    $(this).css("color","");
		  }
		);

	</script>
